Ensure that our variable checking for >= 0 is signed
authorSteve Langasek <steve.langasek@ubuntu.com>
Sat, 14 Dec 2024 18:47:40 +0000 (19:47 +0100)
committerAndreas Tille <tille@debian.org>
Sat, 14 Dec 2024 18:47:40 +0000 (19:47 +0100)
commit12553258ebbe6df5e25f6f691c7493c3f5ca5fd7
treed9a2c86bb9770d9a49da65dc92bc7ca93ec73237
parentc661e5c4d47b4b39e1d43b4d5e0aa78fb022e096
Ensure that our variable checking for >= 0 is signed

Last-Update: 2020-03-17
Bug-Debian: https://bugs.debian.org/954127

The type of v->n is size_t, which is an unsigned type, and we are assigning
v->n - 1 to i and looping while this is >= 0.  If v->n == 0, on some
architectures (armhf) this results in i being set to a positive value
(specifically, UINT32_MAX).

Gbp-Pq: Name ensure-signed-comparison.patch
mag.c